﻿using System.Threading;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using log4net;

namespace Albatross.WPF.Common.PubSub {
	/// <summary>
	/// This subscription will invoke using the thread pool queue
	/// </summary>
	/// <typeparam name="T"></typeparam>
	public class AsyncSubscription<T> : Subscription<T> {
		public override void Invoke(object sender, object msg) {
			System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(args => OnMsgReceived(sender, Convert(msg))));
		}
	}
}
